package com.at.abc.r418;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class a {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int n = Integer.parseInt(br.readLine());
        String s = br.readLine().trim();
        if (n < 3) {
            out.println("No");
        } else {
            String ans = s.substring(n - 3);
            if (ans.equals("tea")) {
                out.println("Yes");
            } else {
                out.println("No");
            }
        }

        out.flush();
        out.close();
        br.close();
    }
}
